import { createApp } from 'vue'
import App from './App.vue'
import Parent from "@/components/Parent.vue";
import store from "@/store/index.js";
import router from "@/router/index.js";
import TodoList from "@/views/TodoList.vue";
import LoginView from "@/views/LoginView.vue";
import vueview from "@/views/vueview.vue";

const app =createApp(LoginView)
app.use(store)
app.use(router)
app.mount('#app')

router.beforeEach((to,from,neex) =>{
    const nextRoute =['/newsIndex','/newsItem','/routerIndex','/parent'];
    let isLogin = store.getters.getLogin;
    if (nextRoute.indexOf(to.path) >=0){
        if (!isLogin){
            router.push({
                path:'/login'
            })
        }
    }
    next();
});




